<template>
	<div id="contentBox">
		<div class="searchBox">
			<el-form :inline="true"  ref="searchForm"  :model="searchForm" label-width="96px">
	            <el-form-item label="订单号"  prop="orderNumber" >
				    <el-input v-model="searchForm.orderNumber"  @input.native="changeQuey()"    placeholder="请输入搜索内容..." ></el-input >
				</el-form-item>
				<el-form-item label="经销商名称" prop="dealerName" >
				    <el-input v-model="searchForm.dealerName"   @input.native="changeQuey()"   placeholder="请输入搜索内容..." ></el-input >
				</el-form-item>
			<!-- 	 <el-form-item label="物流名称" prop="name1" >
				    <el-input v-model="searchForm.logisticsName" placeholder="请输入搜索内容..." ></el-input >
				</el-form-item>  -->
				 <el-form-item label="合同状态" prop="status" >  
				 		<el-select @change="changeQuey()" v-model="searchForm.status"  placeholder="选择合同状态"    >
				 			<el-option label="请选择"  value="" >   
	                      	</el-option>
					     	<el-option label="未签署"  value="1" >   
	                      	</el-option>   
	                        <el-option label="签署中"  value="2" >   
	                      	</el-option>   
	                        <el-option label="已完成"  value="3"  >   
	                      	</el-option>   
					    </el-select> 
				</el-form-item>
				<!-- <el-form-item label="申请日期起"   prop="startDate">
				    <el-date-picker :editable="false"   @change="changeQuey()" 
				      v-model="searchForm.startDate"
				      type="date"
				      placeholder="选择日期"
				      :picker-options="startDateOpt"
				      format="yyyy-MM-dd"
				      >
				    </el-date-picker>
				</el-form-item> --> 

				<el-form-item label="申请日期起" prop="startDate" >
				    <el-date-picker :editable="false"   
				      @change="startDateGet"
				      v-model="searchForm.startDate"
				      type="date"
				      placeholder="选择日期"
				      :picker-options="startDateOpt"
				      format="yyyy-MM-dd"
				      >
				    </el-date-picker>
				</el-form-item>


				<el-form-item label="申请日期止"  prop="endDate">
				    <el-date-picker :editable="false"   
				      @change="endDateGet" 
				      v-model="searchForm.endDate"
				      type="date"
				      placeholder="选择日期"
				      :picker-options="endDateOpt"
				      format="yyyy-MM-dd"
				      >
				    </el-date-picker>
				</el-form-item>
	            <el-form-item label="汽车品牌/车型"  prop="carBrand">
				   <el-input v-model="searchForm.carBrand"  @input.native="changeQuey()"   placeholder="请输入搜索内容..."></el-input >
				</el-form-item>
				 
				<el-form-item style="    margin-bottom: 10px;">
				   <!--  <el-button type="primary" @click="getContractinfoList(searchForm)">搜索</el-button> -->
				    <el-button @click="resetSearchForm('searchForm')">重置</el-button>
				</el-form-item>
			</el-form>
			
		</div> 
		<div id="tableBox" style="margin:0 25px;" >
			<el-table   ref='gr' v-if="tableData" :data="tableData.data" border  >
			    <el-table-column label="订单号" width="120" fixed>
			      <template scope="scope">
			        <span >{{ scope.row.carOrder.orderNumber }}</span>
			      </template>
			    </el-table-column>
			 <!--    <el-table-column label="资金方" >
			      <template scope="scope">
			        <span >{{ scope.row.qcpp }}</span>
			      </template>
			    </el-table-column> -->
			    <el-table-column label="经销商名称" width="250" fixed>
			      <template scope="scope">
			        <span >{{ scope.row.carOrder.dealerName }}</span>
			      </template>
			    </el-table-column>
			    
			    <el-table-column v-if label="汽车车型" min-width="300">
			      <template scope="scope">
			        <span >{{ scope.row.carOrder.carBrandNameAndCarName }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="垫资金额" width="120">
			      <template scope="scope">
			        <span >{{ scope.row.carOrder.paymentAmount |toFixed2 }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="合同名称" width="80">
			      <template scope="scope">
			        <span >{{ scope.row.outName }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column   label="合同状态" width="80">
			      <template scope="scope">
			        <span  v-for="(item, index) in scope.row.contractEnumsVO" :key="index" >{{ item }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column   label="后台签署状态" width="120">
			      <template scope="scope">

			        <span  v-if="userStatus(scope.row.userB,scope.row.userBStatus) === 1">
			        	<el-tag type="danger">{{ scope.row.userBStatusVO }}</el-tag>
			        </span> 
			        <span  v-if="userStatus(scope.row.userB,scope.row.userBStatus) === 2">  
			        	<el-tag type="warning">{{ scope.row.userBStatusVO }}</el-tag>
			        </span>

			      </template>
			    </el-table-column>
			    <el-table-column  label="资金方签署状态" width="120">

			      <template scope="scope">

			        <span  v-if="userStatus(scope.row.funder,scope.row.funderStatus) === 1">
			        	<el-tag type="danger">{{ scope.row.userFunderStatusVO }}</el-tag>
			        </span> 
			        <span  v-if="userStatus(scope.row.funder,scope.row.funderStatus) === 2">  
			        	<el-tag type="warning">{{ scope.row.userFunderStatusVO }}</el-tag>
			        </span>

			      </template>

			     <!--  <template scope="scope">
			        <span >{{ scope.row.userFunderStatusVO }}</span>
			      </template> -->
			    </el-table-column>
			    <el-table-column   label="经销商签署状态" width="120">
			      <!-- <template scope="scope">
			        <span >{{ scope.row.userAStatusVO }}</span>
			      </template> -->


			      <template scope="scope"> 
			        <span  v-if="userStatus(scope.row.userA,scope.row.userAStatus) === 1">
			        	<el-tag type="danger">{{ scope.row.userAStatusVO }}</el-tag>
			        </span> 
			        <span  v-if="userStatus(scope.row.userA,scope.row.userAStatus) === 2">  
			        	<el-tag type="warning">{{ scope.row.userAStatusVO }}</el-tag>
			        </span> 
			      </template>

			    </el-table-column>

			    <el-table-column   label="SPV签署状态" width="120"> 
 				  <template scope="scope"> 
			        <span  v-if="userStatus(scope.row.spv,scope.row.spvStatus) === 1">
			        	<el-tag type="danger">{{ scope.row.userSpvStatusVO }}</el-tag>
			        </span> 
			        <span  v-if="userStatus(scope.row.spv,scope.row.spvStatus) === 2">  
			        	<el-tag type="warning">{{ scope.row.userSpvStatusVO }}</el-tag>
			        </span> 
			      </template> 
			    </el-table-column>

			  <!--   <el-table-column   label="链上车SPV签署状态" width="120"> 
 				  <template scope="scope">  
			        <span  v-if="userStatus(scope.row.lscSpv,scope.row.lscSpvStatus) === 1">
			        	<el-tag type="danger">{{ scope.row.userLscSpvStatusVO }}</el-tag>
			        </span> 
			        <span  v-if="userStatus(scope.row.lscSpv,scope.row.lscSpvStatus) === 2">  
			        	<el-tag type="warning">{{ scope.row.userLscSpvStatusVO }}</el-tag>
			        </span> 
			      </template>   
			    </el-table-column> -->

			     <el-table-column label="生成日期" width="160">
			      <template scope="scope">
			        <span >{{ scope.row.addDate | parseTime }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="操作" width="160" fixed="right">
			      <template scope="scope">
			  <!--     	statusFnished -->
			      	<el-button size="small" type="danger"  @click="handleEdit(scope.$index, scope.row,true)"   v-for="(item, index) in scope.row.contractEnumsVO"  :key="index" v-if="index != statusFnished && index!=0 && userType == 0">废弃</el-button>
			      	<el-button size="small" type="info"  @click="openContract(scope.row.id)">查看</el-button>
			      	<el-button size="small" type="success" @click="handleDown(scope.row.contractId)">下载</el-button>
			    <!--   	<a href="/admin/contract/download_contract_new/626" type="button" class="tabledit-delete-button btn btn-sm btn-default" style="float: none;"><span>下载</span>
			      	</a> -->

			      </template>
			    </el-table-column>
			</el-table>
            <el-dialog  v-if="dialogFormVisible.bool" title="合同管理" :visible.sync="dialogFormVisible.bool"  :lock-scroll='false' top=5% :close-on-click-modal="false" v-dialogDrag>
				<dialogForm v-on:refreshTableData="getContractinfoList()" v-bind:dialogFormVisible="dialogFormVisible" :query="query" :isAdd="isAdd" :tableData="tableData" :rowData="rowData">
				</dialogForm>
				
			</el-dialog>
	    </div>
	    <div class="block" style="text-align: center;margin-top: 15px;">
		     <pagination v-on:refreshSeachData="getContractinfoList()" v-if="tableData" :tableData="tableData" :searchForm="searchForm">
	    	</pagination>
		</div>
		<template><a href="" ref="Jump"></a></template>
	</div>
</template>
 <script src="./index.js">

 </script>

<style scoped lang="stylus" rel="styleheet/stylus">
	@import './index.styl';
</style>